# Maintainer: Antonio Rojas <arojas@archlinux.com>

_pyname=notebook_shim
pkgname=jupyter-notebook-shim
pkgver=0.2.3
pkgrel=2
pkgdesc='Provides a way for JupyterLab and other frontends to switch to Jupyter Server for their Python Web application backend'
arch=(any)
url='https://github.com/jupyterlab/notebook_shim'
license=(BSD)
depends=(jupyter-server)
makedepends=(python-build python-installer python-hatchling)
checkdepends=(python-pytest-tornasync python-pytest-jupyter)
source=(https://pypi.python.org/packages/source/n/$_pyname/$_pyname-$pkgver.tar.gz)
sha256sums=('f69388ac283ae008cd506dda10d0288b09a017d822d5e8c7129a152cbd3ce7e9')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver/$_pyname
  pytest -v
}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
  mv "$pkgdir"/{usr/,}etc
}
